<?php
include("../dao/login.php");
require_once('../dao/database.php');
$class_db = new Database;
$log = new Login_Dao($class_db);
if($_REQUEST['Submit'] == "Login"){
if($log->login("user", $_REQUEST['myusername'], $_REQUEST['mypassword']) == true){
    if(isset($_SESSION['cart'])){
        //masih belum menge-cek klo sudah menambah keranjang tp loginnya di beranda
        header("location:cart_view.php?modul=alamat");
    }else{
        header("location:index.php");
    }

}else{
echo "Wrong Username or Password </br>
    <a href='reset_password.php'>RESET PASSWORD</a>";
}
}
?>